package cn.edu.seig.textbook.mapper;

import cn.edu.seig.textbook.domain.pojo.Users;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author day
 * @since 2024-11-07
 */
@Mapper
public interface UsersMapper extends BaseMapper<Users> {
    // 根据用户名模糊查询用户
    @Select("SELECT * FROM tb_users WHERE username LIKE CONCAT('%', #{username}, '%')")
    List<Users> getUsersByUsername(String username);

    @Select("SELECT * FROM tb_users WHERE username=#{usernaem} and password=#{password}")
    Users findByUsernameAndPassword(String username, String password);
}
